class Subject{
    constructor(){
        this.callbacks = {}
    }

    scribble(prop , element , callback){//type , name , callback通知方式 
        !this.callbacks[prop] && (this.callbacks[prop]=[]);
        if(!callback){
            callback = function(value){
                //只要负责更新内容
                element.innerHTML = value;
            }
        }
        this.callbacks[prop].push({
            element,
            callback,
            prop
        })
    }

    publish(prop , value){ // type => 房源类型
        this.callbacks[prop].forEach((item)=>{
            // console.log(item)
            item.callback(value);
        })
    }

    unscribble(){

    }
}